<template>
  <h2>App 父级组件</h2>
  <h3>msg:{{msg}}</h3>
  <button @click="msg += '==='">更新数据</button>
  <hr/>
  <child @xxx="xxx" :msg="msg" msg2="haha" />
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
import Child from './components/Child.vue'
export default defineComponent ({
  name:'App',
  components: { Child },
  setup() {
    // 定义一个ref类型数据
    const msg = ref('what are you no sha lei')

    function xxx(txt: string) {
      msg.value += txt
    }
    return {
      msg,xxx
    }
  }
})
</script>